import { createRequest } from '/@/api/service';
const module = 'ib/archive/v1/ArchiveChangeAlterApi/';

/**
 * @function 设备变更——列表查询
 * @param data
 * @param header
 * @returns
 */
function QUERY_CHANGE_ALTER_LIST(
  data: ArchiveChangeAlterApi.QueryChangeAlterListReq,
  header: object = {},
): Promise<ArchiveChangeAlterApi.QueryChangeAlterListResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryChangeAlterList`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 变更归还——新增变更
 * @param data
 * @param header
 * @returns
 */
function INSERT_CHANGE_ALTER(
  data: ArchiveChangeAlterApi.InsertChangeAlterReq,
  header: object = {},
): Promise<ArchiveChangeAlterApi.InsertChangeAlterResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}insertChangeAlter`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 变更归还—查看详情
 * @param data
 * @param header
 * @returns
 */
function QUERY_CHANGE_ALTER_DETAIL(
  data: ArchiveChangeAlterApi.QueryChangeAlterDetailReq,
  header: object = {},
): Promise<ArchiveChangeAlterApi.QueryChangeAlterDetailResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryChangeAlterDetail`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 设备变更——变更审批
 * @param data
 * @param header
 * @returns
 */
function APPROVAL_CHANGE_ALTER(
  data: ArchiveChangeAlterApi.ApprovalChangeAlterReq,
  header: object = {},
): Promise<ArchiveChangeAlterApi.ApprovalChangeAlterResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}approvalChangeAlter`,
    data,
    header,
    'POST',
  );
}

export {
  QUERY_CHANGE_ALTER_LIST,
  INSERT_CHANGE_ALTER,
  QUERY_CHANGE_ALTER_DETAIL,
  APPROVAL_CHANGE_ALTER,
};
